﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Pyramid.Models
{
	/// <summary>
	/// 员工工资设定
	/// </summary>
	public class StaffSalarySetMaster
	{
		public int Id { get; set; }

		[Display(Name = "员工序号")]
		public int StaffId { get; set; }

		/// <summary>
		/// 生效日期，一般选某月1号
		/// </summary>
		[Display(Name = "生效日期")]
		public DateTime EffectiveDate { get; set; }

		[Display(Name = "备注")]
		[MaxLength(50)]
		public string Remark { get; set; }

		[Display(Name = "建档日期")]
		public DateTime CreateTime { get; set; }

		[Display(Name = "建档人")]
		[MaxLength(20)]
		public string CreateUserId { get; set; }

		[Display(Name = "最后修改时间")]
		public DateTime EditTime { get; set; }

		[Display(Name = "最后修改人")]
		[MaxLength(20)]
		public string EditUserId { get; set; }

		[ForeignKey("StaffId")]
		public virtual Staff Staff { get; set; }

		public virtual ICollection<StaffSalarySetDetail> StaffSalarySetDetails { get; set; }
	}

	public class StaffSalarySetDetail
	{
		public int Id { get; set; }
		public int MasterId { get; set; }
		public int PartId { get; set; }
		public decimal Value { get; set; }

		[ForeignKey("MasterId")]
		public virtual StaffSalarySetMaster StaffSalarySetMaster { get; set; }

		[ForeignKey("PartId")]
		public virtual SalaryPart SalaryPart { get; set; }
	}
}